home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Loadstar 2
/
002.d81
/
mc test maker
(
.txt
)
< prev
next >
Wrap
Commodore BASIC
|
2022-08-26
|
3KB
|
96 lines
1 rem multiple choice test maker
2 poke783,peek(783)and254:print""
5 printchr$(147):gosub5000:printchr$(147)
10 input"number of questions ";nu:print
12 printchr$(147)
15 dimwd$(nu),s1$(nu),s2$(nu),s3$(nu),cn$(nu)
20 forx=1tonu
30 input"question ";wd$(x):print
40 input"choice a ";s1$(x):print
50 input"choice b ";s2$(x):print
60 input"choice c ";s3$(x):print
70 input"answer (a-c) ";cn$(x)
72 ifcn$(x)="a"orcn$(x)="b"orcn$(x)="c"thengoto75
73 print"[145][145]":goto70
75 printchr$(147)
80 next
90 printchr$(147)
100 forx=1tonu
105 printchr$(147)
110 poke781,1:poke782,0:sys65520:print"1. question ";wd$(x):print
120 poke781,3:poke782,0:sys65520:print"2. choice a ";s1$(x):print
130 poke781,5:poke782,0:sys65520:print"3. choice b ";s2$(x):print
140 poke781,7:poke782,0:sys65520:print"4. choice c ";s3$(x):print
150 poke781,9:poke782,0:sys65520:print"5. correct answer ";cn$(x)
160 poke781,23:poke782,0:sys65520:print"is this correct (y/n)?[160]";
170 poke198,0:wait198,1:geta$:ifa$<>"y"anda$<>"n"then170
180 ifa$="y"then 260
190 poke781,23:poke782,0:sys65520:print"enter number to change - ";
200 poke198,0:wait198,1:geta$:a=val(a$)
210 ifa<1ora>5then190
220 ifa=1thenpoke781,1:poke782,11:sys65520:inputwd$(x):goto160
230 ifa=2thenpoke781,3:poke782,11:sys65520:inputs1$(x):goto160
240 ifa=3thenpoke781,5:poke782,11:sys65520:inputs2$(x):goto160
245 ifa=4thenpoke781,7:poke782,11:sys65520:inputs3$(x):goto160
250 ifa=5thenpoke781,9:poke782,18:sys65520:inputcn$(x)
252 ifcn$(x)="a"orcn$(x)="b"orcn$(x)="c"then160
254 goto250
260 next
900 printchr$(147)
910 print"enter file name (9 character limit)
912 [153]"(x to exit)"
920 [133]fi$:[139]fi$[178]"x"[167]2000
930 [151]781,23:[151]782,1:[158]65520:[153]"is this correct (y/n)?close";
940 [151]198,0:[146]198,1:[161]a$
950 [139]a$[178]"y"[167]1000
960 [139]a$[178]"n"[167]900
970 [137]930
1000 [159]4,8,4,"0:"[170]fi$[170]",seq,write"
1010 [152]4,nu
1020 [129]x[178]1[164]nu
1030 [152]4,wd$(x)
1040 [152]4,s1$(x)
1050 [152]4,s2$(x)
1060 [152]4,s3$(x)
1070 [152]4,cn$(x)
1080 [130]
1090 [160]4
2000 [153][199](147)
2010 [153]"do you want to create another file (y/n)?close";
2020 [151]198,0:[146]198,1:[161]a$
2030 [139]a$[178]"y"[167][156]:[153][199](147):[137]10
2040 [139]a$[179][177]"n"[167]2000
2050 [153]"loadload"[199](34)"payload"[199](34)",8":[153]"run"
2055 [151]631,13:[151]632,13:[151]198,2
2060 [128]
4997 :
4998 [143] title page and instructions
4999 :
5000 [153][199](147):[151]53272,23
5010 [151]781,5:[151]782,7:[158]65520:[153]"(NULL)(NULL)(NULL)(NULL)right$(NULL)(NULL)valcloselenleft$(NULL)right$lenvalclose(NULL)val(NULL)(NULL) (NULL)atn(NULL)val(NULL)"
5020 [151]781,8:[151]782,19:[158]65520:[153]"by"
5030 [151]781,11:[151]782,13:[158]65520:[153]"str$onna (NULL). (NULL)oody"
5040 [151]781,23:[151]782,7:[158]65520:[153]"(NULL)(NULL)val(NULL)(NULL) (NULL)(NULL)atnlenval peekatn(NULL) (NULL)(NULL) len(NULL)(NULL)(NULL)right$(NULL)(NULL)val.";
5050 [151]198,0:[146]198,1:[161]a$
5060 [153][199](147)
5070 [153]" (NULL)his program is designed to help":[153]
5080 [153]"you create text files for (NULL)(NULL)(NULL)(NULL)right$(NULL)(NULL)val":[153]
5090 [153]"lenleft$(NULL)right$lenval (NULL)val(NULL)(NULL)val(NULL).":[153]
5100 [153]" (NULL)ou will be asked for the number of":[153]
5110 [153]"questions that will be in the test.":[153]
5120 [153]"(NULL)hen you will be asked for the question":[153]
5130 [153]"and for three possible answers. (NULL)ou":[153]
5140 [153]"will then enter the correct choice as":[153]
5150 [153]"a letter (atn-len).":[153]
5160 [151]781,23:[151]782,7:[158]65520:[153]"(NULL)(NULL)val(NULL)(NULL) (NULL)(NULL)atnlenval peekatn(NULL) (NULL)(NULL) len(NULL)(NULL)(NULL)right$(NULL)(NULL)val.";
5170 [151]198,0:[146]198,1:[161]a$
5190 [153][199](147):[153]" (NULL)his program could easily be":[153]
5200 [153]"modified to create text files for any":[153]
5210 [153]"program that uses sequential text":[153]
5220 [153]"files. (NULL)ist the program and study how":[153]
5230 [153]"it is written to see what you'll need":[153]
5240 [153]"to change.":[153]
5250 [151]781,23:[151]782,7:[158]65520:[153]"(NULL)(NULL)val(NULL)(NULL) (NULL)(NULL)atnlenval peekatn(NULL) (NULL)(NULL) len(NULL)(NULL)(NULL)right$(NULL)(NULL)val.";
5260 [151]198,0:[146]198,1:[161]a$
5270 [151]53272,21:[142]